import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.io.*;
public class MyFrame2 extends JFrame {
    Image pic;
    MyFrame2(String s){
        super(s);
        setBounds(200,250,600,500);
        try{
            File f=new File("E:\\JAVA\\day-up\\Work7\\图.jpg");
            pic= ImageIO.read(f);
            setIconImage(pic);
        }catch (IOException e){
            System.out.println("无法读取图片文件");
        }
        setVisible(true);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
    public static void main(String[] args) {
        new MyFrame2("绘制自己的Logo");
    }
}
